package ws.jdbc.concurrent.test.tasks;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

/**
 *
 * @author Wilson Santos, 36228 <wilson.santos@ua.pt>
 */
public abstract class ResultSetRunnable implements Runnable {

  protected static Connection con;
  protected static String sql_Select;
  protected final Statement st;
  protected final ResultSet rs;
  protected int num = 15;
  protected String str1 = "rs1", str2 = "rs2";
  protected float decimal = 34.2f;

  public ResultSetRunnable() throws SQLException {
    st = con.createStatement(
            ResultSet.TYPE_SCROLL_SENSITIVE,
            ResultSet.CONCUR_UPDATABLE);
    rs = st.executeQuery(sql_Select);
  }

  public static void setCon(Connection con) {
    ResultSetRunnable.con = con;
  }

  public static void setSql_Select(String sql_Select) {
    ResultSetRunnable.sql_Select = sql_Select;
  }
}
